<%--
  Created by IntelliJ IDEA.
  User: WZL
  Date: 2020/5/9
  Time: 14:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ page import="top.fyxxxx.dbdesign.dao.DBoperate" %>
<%@ page import="top.fyxxxx.dbdesign.data.PersonalData" %>
<%@ page import="top.fyxxxx.dbdesign.util.Reporter" %>
<%@ page import="java.util.Map" %>
<%@ page import="top.fyxxxx.dbdesign.data.SignInTask" %>
<%@ page import="top.fyxxxx.dbdesign.data.SignInRecord" %>
<%@ page import="top.fyxxxx.dbdesign.util.SysUtil" %>
<%
    if(session.getAttribute("uid")==null)request.getRequestDispatcher("/index.jsp").forward(request,response);
    Reporter reporter = Reporter.getInstance();
    DBoperate dBoperate=DBoperate.getInstance();
    long uid = Long.parseLong(request.getParameter("uid"));
    long cid = Long.parseLong(request.getParameter("cid"));
    PersonalData personalData = reporter.getPersonalData(uid, uid, cid);
    String name = DBoperate.getInstance().getCourse(cid).getName();

%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>签到详情</title>
    <link rel="stylesheet" type="text/css" href="inf.css">
    <link rel="stylesheet" type="text/css" href="boxAndButton.css">
</head>
<body>
<div id="content" style="text-align: center">
    <p class="title"><b><%=dBoperate.getAccountByUid(uid).getName()%>  <%=name%>
    </b></p>
    <table>

        <%
            int colpos = 0;
            for (Map.Entry<SignInTask, SignInRecord> e : personalData.getTotalTask().entrySet()) {
                colpos++;
                SignInTask signinTask = e.getKey();
                SignInRecord signInRecord = e.getValue();
                if (colpos == 5) {
                    colpos = 0;
        %>
        <tr><%
            }
        %>
            <td><%
                if (signinTask != null) {
            %>
                <div id="block"></div>
                <%
                } else {
                %>
                <div id="block_unsign"></div>
                <%
                    }
                    String date = SysUtil.getDate(signinTask.getBeginTime());
                %>
                    <a style="text-decoration: none" href="signin.jsp?sid=<%=signinTask.getSid()%>"> &nbsp <%=date%></a>

            </td>
            <%
                }
            %></tr>
    </table>


</div>

</body>
</html>

